package io.github.chutian0610.sqlparser.dialect

import io.github.chutian0610.sqlparser.token.CodePoint

class ClickHouse : Dialect {
    override fun isIdentifierPart(c: CodePoint): Boolean {
        return isIdentifierStart(c) || c.isAsciiDigit()
    }

    /**
     * See https://clickhouse.com/docs/en/sql-reference/syntax/#syntax-identifiers
     */
    override fun isIdentifierStart(c: CodePoint): Boolean {
        return c.isAsciiLowercase() || c.isAsciiUppercase() || CodePoint.equalsChar(c, '_')
    }

    override fun supportsStringLiteralBackslashEscape(): Boolean = true

    override fun supportsNumericLiteralUnderscores(): Boolean = true
}